let data = { type: 3, role: "admin" };

let { type, role } = data;



let actions = new Map([
  [{ role: "admin", type: 1 }, ["color1", "index1"]],
  [{ role: "admin", type: 2 }, ["color2", "index2"]],
  [{ role: "admin", type: 3 }, ["color3", "index3"]],
  [{ role: "admin", type: 4 }, ["color4", "index4"]],
  [{ role: "admin", type: 5 }, ["color5", "index5"]],
  [{ role: "guest", type: 1 }, ["guest_color1", "guest_index1"]],
  [{ role: "guest", type: 2 }, ["guest_color2", "guest_index2"]],
  [{ role: "guest", type: 3 }, ["guest_color3", "guest_index3"]],
  [{ role: "guest", type: 4 }, ["guest_color4", "guest_index4"]],
  [{ role: "guest", type: 5 }, ["guest_color5", "guest_index5"]],
]);
let buttonEvent = (type, role) => {
  [...actions]
    .filter(([key]) => key.role === role && key.type === type)
    .forEach(([k, v]) => {
      let [color, target] = v
      console.log(color, target);
    });
};

buttonEvent(type, role);
